package org.uu.mybatisplus.component;

import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class StartupTimeListener implements ApplicationListener<ApplicationStartedEvent> {
    private long startupTime;
    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        startupTime = System.currentTimeMillis();
    }

    public long getStartupTime() {
        return startupTime;
    }
}
